package com.appkubes.mall.admin.application.coupon.service.impl;

import com.appkubes.mall.admin.application.coupon.dao.CouponDao;
import com.appkubes.mall.admin.application.coupon.service.CouponService;
import com.appkubes.mall.core.entity.MallCoupon;
import com.appkubes.mall.core.service.impl.BaseMallCouponServiceImpl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CouponServiceImpl extends BaseMallCouponServiceImpl implements CouponService {

    @Autowired
    CouponDao couponDao;

    public IPage<MallCoupon> querySelective(Integer type, Integer pageNo, Integer pageSize) {
        MallCoupon query = new MallCoupon();
        query.setType(type);

        Page<MallCoupon> page = new Page<>(pageNo, pageSize);
        IPage<MallCoupon> list = this.selectPageByEntity(query, page);
        return list;
    }


    public int batchenable(String[] ids) {
        return couponDao.batchenable(ids);
    }

    public int batchunenable(String[] ids) {
        return couponDao.batchunenable(ids);
    }


}
